package com.yy.micro.magic.data.entity;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.yy.micro.magic.data.model.base.JpaObjectWithDynamicFields;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Proxy;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Proxy(lazy = false)
@Entity
@Table(name = "T_M_CODE_ITEM")
public class CodeMapItemEntity extends JpaObjectWithDynamicFields {

    @Id
    @Column(name="ITEM_ID")
    @GeneratedValue(strategy = GenerationType.AUTO,generator = "snowflake")
    @GenericGenerator(name = "snowflake",strategy = SnowflakeIdWorker.NAME)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long itemId;
    @Column(name = "CODE_ID",nullable = false)
    private Long codeId;
    @Column(name = "CODE_NAME")
    private String codeName;
    @Column(name = "SRC_ITEM_NAME")
    private String srcItemName;
    @Column(name = "SRC_VALUE",nullable = false)
    private String srcValue;
    @Column(name = "TARGET_ITEM_NAME")
    private String targetItemName;
    @Column(name = "TARGET_VALUE",nullable = false)
    private String targetValue;
    private String description;
    private boolean disable = Boolean.FALSE;

    public Long getItemId() {
        return itemId;
    }

    public void setItemId(final Long itemId) {
        this.itemId = itemId;
    }

    public Long getCodeId() {
        return codeId;
    }

    public void setCodeId(final Long codeId) {
        this.codeId = codeId;
    }

    public String getCodeName() {
        return codeName;
    }

    public void setCodeName(final String codeName) {
        this.codeName = codeName;
    }

    public String getSrcItemName() {
        return srcItemName;
    }

    public void setSrcItemName(final String srcItemName) {
        this.srcItemName = srcItemName;
    }

    public String getSrcValue() {
        return srcValue;
    }

    public void setSrcValue(final String srcValue) {
        this.srcValue = srcValue;
    }

    public String getTargetItemName() {
        return targetItemName;
    }

    public void setTargetItemName(final String targetItemName) {
        this.targetItemName = targetItemName;
    }

    public String getTargetValue() {
        return targetValue;
    }

    public void setTargetValue(final String targetValue) {
        this.targetValue = targetValue;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(final String description) {
        this.description = description;
    }

    public boolean isDisable() {
        return disable;
    }

    public void setDisable(final boolean disable) {
        this.disable = disable;
    }

    @Override
    public String getIdProperty() {

        return "itemId";
    }
}
